import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm';

@Entity('content_category')
export class Category {
  @PrimaryGeneratedColumn({ name: 'category_id', comment: '分类id' })
  categoryId: number;

  @Column({ name: 'category_pid', default: 0, comment: '分类pid' })
  categoryPid: number;

  @Column({ 
    name: 'category_name', 
    length: 255, 
    default: '', 
    comment: '分类名称' 
  })
  categoryName: string;

  @Column({ 
    name: 'category_unique', 
    length: 127, 
    default: '', 
    comment: '分类标识' 
  })
  categoryUnique: string;

  @Column({ name: 'image_id', default: 0, comment: '图片id' })
  imageId: number;

  @Column({ length: 255, default: '', comment: '标题' })
  title: string;

  @Column({ length: 255, default: '', comment: '英文' })
  enname: string;

  @Column({ length: 255, default: '', comment: '关键词' })
  keywords: string;

  @Column({ length: 255, default: '', comment: '描述' })
  description: string;

  @Column({ default: 250, comment: '排序' })
  sort: number;

  @Column({ length: 255, default: '', comment: '备注' })
  remark: string;

  @Column({ 
    name: 'is_disable', 
    type: 'tinyint', 
    width: 1, 
    default: 0, 
    comment: '是否禁用，1是0否' 
  })
  isDisable: number;

  @Column({ 
    name: 'is_delete', 
    type: 'tinyint', 
    width: 1, 
    default: 0, 
    comment: '是否删除，1是0否' 
  })
  isDelete: number;

  @Column({ name: 'create_uid', default: 0, comment: '添加用户id' })
  createUid: number;

  @Column({ name: 'update_uid', default: 0, comment: '修改用户id' })
  updateUid: number;

  @Column({ name: 'delete_uid', default: 0, comment: '删除用户id' })
  deleteUid: number;

  @Column({ 
    name: 'create_time', 
    type: 'datetime', 
    nullable: true, 
    comment: '添加时间' 
  })
  createTime: Date;

  @Column({ 
    name: 'update_time', 
    type: 'datetime', 
    nullable: true, 
    comment: '修改时间' 
  })
  updateTime: Date;

  @Column({ 
    name: 'delete_time', 
    type: 'datetime', 
    nullable: true, 
    comment: '删除时间' 
  })
  deleteTime: Date;

  @Column({ length: 255, nullable: true, comment: '文章类型' })
  type: string;

  @Column({ length: 255, nullable: true })
  icon: string;

  @Column({ length: 255, default: '', comment: '连接' })
  url: string;

  @Column({ 
    name: 'small_image_id', 
    default: 0, 
    comment: '手机banner' 
  })
  smallImageId: number;
}